package com.dyh.quickdemo.stub;

/*
@Author=Joey Wheeler
@Date=2021/4/15 14:00
*/
public class StubThreadLocalSupport{

    private static ThreadLocal<Stub> threadLocal = new ThreadLocal<>();

    public static <T extends Stub> void set(T stub){
        threadLocal.set(stub);
    }

    public static <T extends Stub>  T get(){
        return (T)threadLocal.get();
    }

    public static void clear(){
        threadLocal.set(null);
    }
}
